home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / arraymin.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.0 KB  |  44 lines

  1. <!--- This view-only example shows the use of ArrayMax and ArrayMin --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ArrayMin Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9.  
  10. <H3>ArrayMin Example</H3>
  11. <P>
  12. This view-only example uses ArrayMax and ArrayMin
  13. to determine the largest and smallest elements
  14. in an array.
  15. <P>
  16. See the View Example pane to view the code.
  17. <!--- create an array and run a standard search --->
  18. <!---
  19. <CFSET myNumberArray = ArrayNew(1)>
  20.  
  21.  <CFSEARCH NAME="SearchSnippets"
  22.         COLLECTION="snippets"
  23.         TYPE="simple"
  24.         CRITERIA="Array*">
  25. <CFSET temp = 1>
  26. --->
  27. <!--- output the results of the search --->
  28. <!---
  29. <CFOUTPUT QUERY="SearchSnippets">
  30.     <CFSET myNumberArray[temp] = score>
  31.     <CFSET temp = temp + 1>
  32. </CFOUTPUT>
  33. <CFOUTPUT>
  34. The largest numeric element of the
  35. #ArrayLen(myNumberArray)# elements
  36. is #ArrayMax(myNumberArray)#.  The smallest element
  37. is #ArrayMin(myNumberArray)#.
  38. </CFOUTPUT>
  39. --->
  40.  
  41. </BODY>
  42. </HTML>       
  43.      
  44.